package com.trio.gamerental.sys.controller;

import com.trio.gamerental.controller.BaseController;
import com.trio.gamerental.model.AdminInfo;
import com.trio.gamerental.util.MD5Util;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by 张俊强~ on 2016/10/25.
 * function:
 */
@Controller
@RequestMapping
public class TestController  extends BaseController {


    @RequestMapping(value = "/test", method = RequestMethod.GET)
    public String test() {
        return "/jsp/test/index1.1.jsp";
    }

    @ResponseBody
    @RequestMapping(value = "/getmessage", method = RequestMethod.POST)
    public AdminInfo getMessage(String id,String psw) {
        AdminInfo adminInfo=new AdminInfo();
        adminInfo.setAdminId(id);
        if(psw!=""&&psw!=null)
            psw= MD5Util.hash(psw);
        adminInfo.setAdminPsw(psw);
        System.out.println("我的消息==="+adminInfo.getAdminId());
        return adminInfo;
    }
}
